package com.example.user_service.service;

import com.example.user_service.dao.UserDelete;
import com.example.user_service.dao.UserInsert;
import com.example.user_service.dao.UserSelect;
import com.example.user_service.dao.UserUpdate;
import com.example.user_service.vo.Administrator;
import com.example.user_service.vo.MyTracks;
import com.example.user_service.vo.User_Member;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author XiaoLiu
 * @date 2021-12-08 16:09
 **/
@Service
public class LserviceImpl implements Lservice
{
    @Autowired
    UserSelect userSelect;

    @Autowired
    UserInsert userInsert;

    @Autowired
    UserDelete userDelete;

    @Autowired
    UserUpdate userUpdate;

    @Override
    public List<Administrator> AdministratorSelect(String createdatestr, String enddatestr, String account) {
        return userSelect.AdministratorSelect(createdatestr,enddatestr,account);
    }

    @Override
    public boolean check_Administrator(Administrator administrator) {
        return userSelect.check_Administrator(administrator)==null;
    }

    @Override
    public int create_Administrator(Administrator administrator) {
        return userInsert.create_Administrator(administrator);
    }

    @Override
    public int delete_Administrator(Administrator administrator) {
        return userDelete.delete_Administrator(administrator);
    }

    @Override
    public int update_Administrator(Administrator administrator) {
        return userUpdate.update_Administrator(administrator);
    }

    @Override
    public int update_Administrator_state(Administrator administrator) {
        return userUpdate.update_Administrator_state(administrator);
    }

    @Override
    public User_Member select_member_existing_integral(int userid) {
        return userSelect.select_member_existing_integral(userid);
    }

    @Override
    public int update_member_existing_integral(int userid, String str) {
        return userUpdate.update_member_existing_integral(userid,str);
    }

    @Override
    public List<MyTracks> select_my_tracks(int userid) {
        return userSelect.select_my_tracks(userid);
    }

    @Override
    public int delete_my_tracks(int tracks_id) {
        return userDelete.delete_my_tracks(tracks_id);
    }

    @Override
    public int insert_my_tracks(int user_id, int footprint_id) {
        return userInsert.insert_my_tracks(user_id,footprint_id);
    }
}
